import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import {resolve} from "path";

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  server: {
    port: 9005,
    hmr: true,
    open:true,
    proxy: {
      '/api': {
        target: 'http://localhost:9004', // 后端实际端口
        changeOrigin: true,
        rewrite: path => path//不修改路径
      }
    }
  },
  resolve: {
    alias: {
      '@': resolve(__dirname, 'src')//可直接使用相对路径
    },
  },
})
